package service

import (
	"github.com/gogf/gf/frame/g"
	"quabg/app/model"
)

func MakeJson(code int, msg string, data interface{}) g.Map {
	return g.Map{
		"code": code,
		"msg":  msg,
		"data": data,
		//"notify": [],
	}
}

func MakeJsonOK(data interface{}) g.Map {
	var dt interface{} = nil
	if data != nil {
		dt = data
	}
	return MakeJson(model.Code_OK, "ok", dt)
}

func MakeJsonErr(msg string) g.Map {
	return MakeJson(model.Code_Err, msg, "")
}

func MakeJsonUnAuth(msg string) g.Map {
	return MakeJson(model.Code_UnAuth, msg, "")
}
